# lambda的另外一个名称叫匿名函数
def fn1():
    return 200


print(fn1)
print(fn1())

fn2 = lambda: 200

print(fn2)
print(fn2())

def add(a,b):
    return a+b

result1=add(1,2)
print(result1)

fn3=lambda a,b:a+b
print(fn3(1,2))

fn4=lambda a,b,c=100:a+b+c

print(fn4(1,2,3,))

fn5=lambda *args:args

print(fn5(1,2,3))

fn6=lambda **kwargs:kwargs

print(fn6(name='pan',age=30))


fn7=lambda a,b:a if a>b else b

print(fn7(10,20))

students=[
    {'name':'pan','age':30},
    {'name':'test','age':20},
    {'name':'python','age':10}
]

students.sort(key=lambda x:x['age'])

print(students)
